package chapters.appenders.socket;

import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.net.SocketAddress;

/**
 * Created by YLC on 2017/11/8 0008.
 */
public class SocketClientTest {
    public static void main(String[] args) throws Exception {
        Socket socket = new Socket();
        SocketAddress sa = new InetSocketAddress("localhost", 4321);
        socket.connect(sa);
        OutputStream os = socket.getOutputStream();
        os.write("ylc".getBytes());
        os.flush();
        Thread.sleep(100000000L);
    }
}
